var MongoClient = require('mongodb').MongoClient;
var dbUrl = 'mongodb://localhost:27017/';
var dbName = 'yimi';
MongoClient.connect(dbUrl, (err, client) => {
    if(err){
        console.log(err)
        return 
    }
    var db = client.db(dbName);
    db.collection('appointment').insertOne({'name': '张三', 'age': 20}, function(err, result){
        if(!err){
            console.log('增加成功')
            return;
        }
    });
});